home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 011 / mv1.arc / MV.DOC next >
Encoding:
Text File  |  1985-03-27  |  4.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4.             MV - Move or Rename Files/Sub-directories
  5.                   Version 1.01 - March 26, 1985
  6.                 For PC-DOS Versions 2.0 and Above
  7.  
  8.  
  9.  
  10.             (C) Copyright 1985 Harry G. McGavran, Jr.
  11.                        All Rights Reserved
  12.  
  13. PERMISSION TO USE, COPY, MODIFY, AND DISTRIBUTE THIS PROGRAM AND
  14. ITS DOCUMENTATION FOR ANY PURPOSE AND WITHOUT FEE IS HEREBY
  15. GRANTED, PROVIDED THAT THE COPYRIGHT NOTICE, THIS NOTICE, AND THE
  16. DISCLAIMER OF WARRANTY NOTICE APPEAR ON ALL COPIES AND SUPPORTING
  17. DOCUMENTATION.
  18.  
  19.  
  20.  
  21.                      DISCLAIMER OF WARRANTY
  22.  
  23. THE AUTHOR MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS
  24. SOFTWARE FOR ANY PURPOSE.  THIS SOFTWARE IS PROVIDED "AS IS"
  25. WITHOUT EXPRESS OR IMPLIED WARRANTY.  THE USER IS ADVISED TO TEST
  26. THE PROGRAM THOROUGHLY BEFORE RELYING ON IT.  THE USER MUST AS-
  27. SUME THE ENTIRE RISK OF USING THE PROGRAM.  NO LIABILITY FOR THE
  28. USE OF THIS PROGRAM IN ANY FORM IS ASSUMED BY THE AUTHOR.
  29.  
  30.  
  31.  
  32. The PC-DOS "rename" command performs a function similar to "mv"
  33. except that "rename" does not work with sub-directory names.
  34. "Mv" also will allow moving a branch of a directory from one
  35. place to another.
  36.  
  37. "Mv" is invoked with the command line:
  38.  
  39.      mv from_path to_path
  40.  
  41. "Mv" moves (changes the name of) the node specified by
  42. "from_path" to the node specified by "to_path" in the style of
  43. the UNIX "mv".
  44.  
  45. If "to_path" specifies an existing FILE name, then the move will
  46. not be performed.
  47.  
  48. If "to_path" specifies an existing DIRECTORY name instead of a
  49. FILE name, then the node specified by "from_path" is moved into
  50. that directory.  If the node specified by "from_path" already ex-
  51. ists in the directory specified by "to_path", then the move will
  52. not be performed.  If the directory specified by "to_path" is a
  53. sub-directory and has no free directory slots available, then the
  54. move will not be performed even though another cluster could be
  55. added to the sub-directory to make more free slots.
  56.  
  57. If "to_path" specifies an existing DIRECTORY name, then
  58. "from_path" may be specified with wildcards.  If "to_path" speci-
  59. fies a FILE name and the file does not exist, and "from_path" is
  60. specified with wildcards, only the first matching file found will
  61. be moved.
  62.  
  63. "To_path" may not be specified with wildcards.
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. "Mv" works by modifying the directory entries.  "Mv" does not
  71. copy any data.  This means that "mv" will work only within one
  72. disk.  Because PC-DOS versions 3.0 and above provide no system
  73. services for directly reading and modifying file cluster pointers
  74. in directories (see note below), it also means that renaming a
  75. file with "mv" requires more time than the PC-DOS "rename" com-
  76. mand.  "Mv" must perform functions similar to the PC-DOS "chkdsk"
  77. command and requires about the same amount of time as "chkdsk"
  78. does to run.  If wildcards are specified and "n" matches are
  79. found, then "mv" requires about the same time as running "chkdsk"
  80. "n" times.  But renaming or moving an entire sub-directory re-
  81. quires considerably less time than copying the contents, which
  82. was the only alternative using the PC-DOS commands.
  83.  
  84. Since "mv" was written based upon data structures that IBM has
  85. indicated may change in future releases of PC-DOS, to date "mv"
  86. has been verified only with  PC-DOS versions 2.0, 2.1, and 3.0.
  87.  
  88. If you find this program useful, and wish to make a small contri-
  89. bution to its author, he may be reached by mail at:
  90.  
  91.           Harry G. McGavran, Jr.
  92.           2506 35th St.
  93.           Los Alamos
  94.           New Mexico 87544
  95.  
  96. Trademarks:
  97.    IBM is a trademark of International Business Machines, Inc.
  98.    PC-DOS is a trademark of I.B.M.
  99.    UNIX is a trademark of Bell Laboratories
  100.  
  101. Note:
  102.    There is an article on one method of reading and writing file
  103.    cluster pointers in sub-directories in the February 1985 issue
  104.    of "PC TECH JOURNAL", page 67, by Ted Mirecki.  He does not
  105.    address root directories, but the techniques are similar.  I
  106.    tried his technique on PC-DOS versions 2.0, 2.1, and 3.0.  I
  107.    found them to work on versions 2.0 and 2.1, but I was not able
  108.    to get them to work on version 3.0.  What Ted Mirecki suggests
  109.    is a special method of opening a sub-directory as a file,
  110.    which then allows the use of the PC-DOS file input/output sys-
  111.    tem calls for modification of the sub-directory.  What I had
  112.    to do instead is direct disk access input/output by tracing
  113.    the sub-directory through the File Allocation Table, since I
  114.    could not treat a sub-directory as a file for output under
  115.    PC-DOS version 3.0.
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.